package MtG.server.components;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

/**
 * ActiveSession.java is the class that designs the games "board" area 
 * where all the cards in play will be situated.
 * @author Marek Sirp
 * @author Jaan Sepp
 */
public class ActiveSession {
	
	/**
	 * List of active clients connected to the server.
	 */
	private Collection<Communication> sessionList = new ArrayList<Communication>();
	
	public synchronized void addSession(Communication communication) {
		sessionList.add(communication);
	}

	/**
	 * Getter for sessionList iterator
	 * @return sessionList iterator
	 */
	public synchronized Iterator<Communication> iterator() { 	
		return sessionList.iterator();
	}

}
